-- 电脑软件信息测试数据插入脚本
-- 请在SQL Server数据库中执行此脚本来创建测试数据

USE [refunddb]  -- 请根据实际数据库名称修改
GO

-- 插入测试数据到 Lzfy_PcSoft_Detail 表
INSERT INTO [dbo].[Lzfy_PcSoft_Detail] 
([Name], [Version], [Publisher], [InstallDate], [InstallLocation], [Source], [MACAddress])
VALUES 
-- MAC地址: 00-11-22-33-44-55 的软件
('Microsoft Office 365', '16.0.14326.20404', 'Microsoft Corporation', '2024-01-15', 'C:\Program Files\Microsoft Office', 'Microsoft Store', '00-11-22-33-44-55'),
('Google Chrome', '120.0.6099.109', 'Google LLC', '2024-01-10', 'C:\Program Files\Google\Chrome', 'Web Download', '00-11-22-33-44-55'),
('Adobe Acrobat Reader DC', '23.008.20470', 'Adobe Inc.', '2024-01-08', 'C:\Program Files\Adobe\Acrobat DC', 'Web Download', '00-11-22-33-44-55'),
('WinRAR', '6.24', 'win.rar GmbH', '2024-01-05', 'C:\Program Files\WinRAR', 'Web Download', '00-11-22-33-44-55'),
('Microsoft Visual Studio Code', '1.85.1', 'Microsoft Corporation', '2024-01-12', 'C:\Users\User\AppData\Local\Programs\Microsoft VS Code', 'Web Download', '00-11-22-33-44-55'),

-- MAC地址: AA-BB-CC-DD-EE-FF 的软件
('Microsoft Office 2019', '16.0.10827.20138', 'Microsoft Corporation', '2023-12-20', 'C:\Program Files\Microsoft Office', 'DVD', 'AA-BB-CC-DD-EE-FF'),
('Mozilla Firefox', '121.0', 'Mozilla Foundation', '2023-12-18', 'C:\Program Files\Mozilla Firefox', 'Web Download', 'AA-BB-CC-DD-EE-FF'),
('7-Zip', '23.01', 'Igor Pavlov', '2023-12-15', 'C:\Program Files\7-Zip', 'Web Download', 'AA-BB-CC-DD-EE-FF'),
('Notepad++', '8.6.2', 'Notepad++ Team', '2023-12-10', 'C:\Program Files\Notepad++', 'Web Download', 'AA-BB-CC-DD-EE-FF'),

-- MAC地址: 11-22-33-44-55-66 的软件
('AutoCAD 2024', '24.0.47.0', 'Autodesk, Inc.', '2024-02-01', 'C:\Program Files\Autodesk\AutoCAD 2024', 'Enterprise License', '11-22-33-44-55-66'),
('Microsoft SQL Server Management Studio', '19.3.4.0', 'Microsoft Corporation', '2024-01-25', 'C:\Program Files (x86)\Microsoft SQL Server Management Studio 19', 'Web Download', '11-22-33-44-55-66'),
('TeamViewer', '15.48.4', 'TeamViewer Germany GmbH', '2024-01-20', 'C:\Program Files\TeamViewer', 'Web Download', '11-22-33-44-55-66');

GO

-- 验证插入的数据
SELECT 
    MACAddress,
    COUNT(*) as SoftwareCount,
    STRING_AGG([Name], ', ') as SoftwareList
FROM [dbo].[Lzfy_PcSoft_Detail]
GROUP BY MACAddress
ORDER BY MACAddress;

GO

-- 查看所有插入的数据
SELECT 
    id,
    [Name],
    [Version],
    [Publisher],
    [InstallDate],
    [MACAddress],
    input_date
FROM [dbo].[Lzfy_PcSoft_Detail]
ORDER BY MACAddress, [Name];

GO

PRINT '测试数据插入完成！';
PRINT '可用的测试MAC地址:';
PRINT '1. 00-11-22-33-44-55 (5个软件)';
PRINT '2. AA-BB-CC-DD-EE-FF (4个软件)';
PRINT '3. 11-22-33-44-55-66 (3个软件)';
PRINT '';
PRINT '请使用这些MAC地址测试API接口。';